package StructuralPattern.FlyweightPattern;

import StructuralPattern.FlyweightPattern.Interfase.ChessPiece;

// 具体享元类，实现了享元接口，包含共享的内部状态
class ConcreteChessPiece implements ChessPiece {
    private final String color; // 颜色是内部状态，不变且可共享

    public ConcreteChessPiece(String color) {
        this.color = color;
    }

    @Override
    public void place(int x, int y) {
        System.out.println("Placing " + color + " chess piece at (" + x + ", " + y + ")");
    }
}
